-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🌱 Move experimental addons API v1beta1 webhooks to separate package #9438
🌱 Move experimental addons API v1beta1 webhooks to separate package #9438
Conversation
/area api |
cc7ef5a
to
f4fdd0b
Compare
/test pull-cluster-api-e2e-full-main |
f4fdd0b
to
f1fa4e1
Compare
/test pull-cluster-api-e2e-full-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some context.
The idea is that for an update call on an object our ValidateUpdate func is called and we get the old and the new object.
Usually we only need the old object if we e.g. want to compare old and new or if it is important how the previous object looked like.
In ValidateCreate we only get one object, the one that is created. We have to pass this into the validation as the "newObj" as the newObj is the one where we usually run the full validation on, while the oldObj is only used for "update" checks
exp/addons/internal/webhooks/clusterresourceset_webhook_test.go
Outdated
Show resolved
Hide resolved
exp/addons/internal/webhooks/clusterresourceset_webhook_test.go
Outdated
Show resolved
Hide resolved
exp/addons/internal/webhooks/clusterresourcesetbinding_webhook.go
Outdated
Show resolved
Hide resolved
exp/addons/internal/webhooks/clusterresourcesetbinding_webhook_test.go
Outdated
Show resolved
Hide resolved
f1fa4e1
to
cf7c263
Compare
@sbueringer thankyou for detailed review. I have incorporated those comments, PTAL. |
3b84957
to
a1c6db7
Compare
/test pull-cluster-api-e2e-full-main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. Last round of nits
exp/addons/internal/webhooks/clusterresourcesetbinding_webhook.go
Outdated
Show resolved
Hide resolved
exp/addons/internal/webhooks/clusterresourcesetbinding_webhook.go
Outdated
Show resolved
Hide resolved
a1c6db7
to
4f32c4f
Compare
PR is ready for review. |
@Ankitasw: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/lgtm |
LGTM label has been added. Git tree hash: d306ebb91b5602ce5349266a4dc847c3648f71b8
|
Thank you! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
To work towards #9011, we need to remove the reliance on controller-runtime from the API packages.
This updates the webhooks to use the CustomDefaulter and CustomValidator pattern and moves them to match the Cluster and ClusterClass webhooks. This Is a more major lift but removes quite a bit of the code from the API package itself, making it's reliance on controller-runtime a lot smaller.
Which issue(s) this PR fixes (optional, in fixes #(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #